home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / bevelPlusToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.5 KB  |  141 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // Copyright (C) 1997-1998 Alias|Wavefront,
  18. // a division of Silicon Graphics Limited.
  19. //
  20. // The information in this file is provided for the exclusive use of the
  21. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  22. // and incorporate this code into other products for purposes authorized
  23. // by the Alias|Wavefront license agreement, without fee.
  24. //
  25. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  26. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  27. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  28. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  29. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. // PERFORMANCE OF THIS SOFTWARE.
  32. //
  33. ///////////////////////////////////////////////////////////////////////////////
  34. //
  35. //  Description:
  36. //  UI hooks for the Automatic mapping plug-in
  37. //
  38. ///////////////////////////////////////////////////////////////////////////////
  39. //
  40. //  Procedure Name:
  41. //      bevelPlusToolScript
  42. //
  43. //  Description:
  44. //    create wrapper around the bevelPlus command
  45. //
  46. //  Input Arguments:
  47. //        0 ==> do the command.
  48. //        1 ==> show the tool/action option box
  49. //        2 ==> return the command
  50. //        3 ==> show tool/action option box
  51. //        4 ==> enter the tool
  52. //
  53. //  Return Value:
  54. //      None.
  55. //
  56.  
  57. global int $bevelPlusUIActive = false;
  58.  
  59. global proc bevelPlusToolSetup( int $forceFactorySettings, string $goToTool )
  60. {
  61.     global int $gStartWithAutoComplete;
  62.     if( $forceFactorySettings || !`optionVar -ex bevelPlusEuc` ) {
  63.         optionVar -iv bevelPlusEuc 0;
  64.     }
  65.     if( $forceFactorySettings || !`optionVar -ex bevelPlusLac` ) {
  66.         optionVar -iv bevelPlusLac $gStartWithAutoComplete;
  67.     }
  68.     if( "" != $goToTool ) {
  69.         scriptCtx -e -euc `optionVar -q bevelPlusEuc` $goToTool;
  70.         scriptCtx -e -lac `optionVar -q bevelPlusLac` $goToTool;
  71.     }
  72. }
  73.  
  74. global proc bevelPlusValues ( string $toolName ) 
  75. {
  76.     performBevelPlus 3 $toolName;
  77.     scriptCtxCommonValues( $toolName );
  78. }
  79.  
  80. global proc bevelPlusProperties()
  81. {
  82.     scriptCtxCommonProperties;
  83. }
  84.  
  85. proc createBevelPlusContext( string $tool )
  86. {
  87.     if( ! `scriptCtx -exists $tool` ) {
  88.         bevelPlusToolSetup( 0, "" );
  89.         scriptCtx -i1 "bevelPlus.xpm"
  90.           -title "Bevel Plus Tool"
  91.           -bcn "bevelPlus"
  92.  
  93.           -exitUponCompletion `optionVar -q bevelPlusEuc`
  94.           -toolCursorType "edit"
  95.           -totalSelectionSets 1
  96.           -expandSelectionList true
  97.           -fcs ("bevelPlusToolScript 0")
  98.  
  99.           -setNoSelectionPrompt ("Select a NURBS curve, surface isoparm, " +
  100.                                  "trim edge or a polygon edge to bevelPlus.")
  101.           -setSelectionPrompt ("Select additional NURBS curves, surface " +
  102.                                "isoparms, trim edge or a polygon edge or " +
  103.                                "press ENTER to compute bevelPlus.")
  104.  
  105.           -setAutoToggleSelection true
  106.           -setAutoComplete `optionVar -q bevelPlusLac`
  107.           -setAllowExcessCount true
  108.           -showManipulators true
  109.  
  110.           -setSelectionCount 0
  111.           -nurbsCurve true
  112.           -isoparm true
  113.           -curveOnSurface true
  114.           -surfaceEdge true
  115.           -polymeshEdge true
  116.         $tool;
  117.     }
  118. }
  119.  
  120. global proc string bevelPlusToolScript( int $setToTool )
  121. //
  122. //    Description :
  123. //        0 ==> do the command.
  124. //        1 ==> show the action option box
  125. //        2 ==> return the command
  126. //        3 ==> show tool/action option box
  127. //        4 ==> enter the tool/do the command
  128. {
  129.     string $tool = "";
  130.     if( $setToTool > 2 ) {
  131.         if( !`optionVar -q modelWithToolBevelPlus` ) {
  132.             $setToTool = 4 - $setToTool;
  133.         }
  134.         else {
  135.             $tool = "bevelPlusContext";
  136.             createBevelPlusContext $tool;
  137.         }
  138.     }
  139.     return scriptToolScript( "performBevelPlus", $setToTool, $tool );
  140. }
  141.